package com.liuh.util;

import java.util.List;

/**
 * @note 分页工具类
 * @author liuh
 * @date 2021年3月30日 上午9:33:12
 */
public class Page<T> {

	private int totalRow;// 总条数
	@SuppressWarnings("unused")
	private int totalPage=0;// 总页数=totalRow%pageSize==0?totalRow/pageSize:totalRow/pageSize+1
	private int pageSize = 5;// 页面容量
	private int pageIndex = 1;// 当前页面
	private List<T> data;

	public int getTotalRow() {
		return totalRow;
	}

	public void setTotalRow(int totalRow) {
		this.totalRow = totalRow;
	}

	public int getTotalPage() {
		return totalRow % pageSize == 0 ? totalRow / pageSize : totalRow / pageSize + 1;
	}

	public int getPageSize() {
		return pageSize;
	}

	public void setPageSize(int pageSize) {
		this.pageSize = pageSize;
	}

	public int getPageIndex() {
		return pageIndex;
	}

	public void setPageIndex(int pageIndex) {
		this.pageIndex = pageIndex;
	}

	public List<T> getData() {
		return data;
	}

	public void setData(List<T> data) {
		this.data = data;
	}

}
